package com.atguigu.gmall.list.controller;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.list.model.Goods;
import com.atguigu.gmall.list.model.SearchParam;
import com.atguigu.gmall.list.model.SearchResponseVo;
import com.atguigu.gmall.list.service.SearchService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
import org.springframework.web.bind.annotation.*;

/**
 * @author: atguigu
 * @create: 2023-03-03 10:10
 */
@Slf4j
@RestController
@RequestMapping("api/test")
public class TestController {


    //Logger logger = LoggerFactory.getLogger(TestController.class);

    /**
     * springboot默认日志框架：LogBack 默认级别：info
     * 日志级别：在日志配置策略中指定日志收集级别，设置处理当前级别，以及比当前级别高日志
     * @return
     */
    @GetMapping("/log")
    public Result testLog() {
        log.debug("debug级别日志");  //开发环境
        log.info("info级别日志");    //开发环境
        log.warn("warn级别日志");    //生产环境
        log.error("error级别日志");  //生产环境
        return Result.ok();
    }

}
